package com.otr.ai.service;

import lombok.extern.slf4j.Slf4j;
import org.springframework.ai.tool.annotation.Tool;
import org.springframework.ai.tool.annotation.ToolParam;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class WeatherService {

  @Tool(description = "查询城市的天气")
  public String queryCityWeather(@ToolParam(description = "具体的城市名称") String cityName) {
    // API调用 / 数据库查询 / 本地处理
    String result = cityName + "的气温为25摄氏度。";
    log.info("==== STDIO Tool Calling, method:queryCityWeather , response: {} =====", result);
    return result;
  }

}
